<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
	<script language="javascript" type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
	<link href="../css/general.css" rel="stylesheet" type="text/css">
	<link href="../css/main.css" rel="stylesheet" type="text/css">
</head>
<body>

	<h1>
		<span class="action-span"><a href="#">订购数据查询</a></span>
		<span class="action-span"><a href="settlementShow">结算数据统计</a></span>
		<span class="action-span1">数据统计 </span>
		<div style="clear: both"></div>
	</h1>

	<div class="form-div">
	<form action="" method="post">
		<input name="group" type="hidden" value="hour">
		<div id="code">
			通道选择：
			<select name="channel_id" id="channel_id">
				<option value="0">-选择通道-</option>
				<c:forEach items="${channels}" var="channel">
					<c:if test="${channel.id == channel_id}">
						<option value="${channel.id}" selected="selected">${channel.name} | ${channel.cmd}-${channel.code}</option>
					</c:if>
					<c:if test="${channel.id != channel_id}">
						<option value="${channel.id}">${channel.name} | ${channel.cmd}-${channel.code}</option>
					</c:if>
				</c:forEach>
			</select> 

			&nbsp;&nbsp; 渠道选择：
			<select name="pipe_id" id="sid">
				<option value="0">-全部-</option>
				<c:forEach items="${pipes}" var="pipe">
					<c:if test="${pipe.id == pipe_id}">
						<option value="${pipe.id}" selected="selected">${pipe.name} | ${pipe.cmd}</option>
					</c:if>
					
					<c:if test="${pipe.id != pipe_id}">
						<option value="${pipe.id}">${pipe.name} | ${pipe.cmd}</option>
					</c:if>
					
				</c:forEach>
			</select>
		 
			&nbsp;&nbsp;开始时间： 
			<input value="${start_at}" name="start_at" class="Wdate" type="text" onfocus="WdatePicker({skin:&#39;whyGreen&#39;})">
			&nbsp;&nbsp; 结束时间：
			<input value="${end_at}" name="end_at" class="Wdate" type="text" onfocus="WdatePicker({skin:&#39;whyGreen&#39;})">
			<input type="submit" value=" 查询 " class="button">
		
		</div>
		</form>
	</div>
	
	<div class="list-div" id="listDiv">
		<table cellpadding="3" cellspacing="1">
			<tbody><tr>
				<th>时间</th>
				<th>通道上行数(条)</th>
				<th>通道订购数(条)</th>
				<th>同步订购数(条)</th>
			</tr>

<c:set var="moTotal" value="0" />
<c:set var="orderTotal" value="0" />
<c:set var="syncTotal" value="0" />
<c:forEach items="${list}" var="cont" varStatus="status">
<c:set var="moTotal" value="${moTotal + cont.moCount}"></c:set>
<c:set var="orderTotal" value="${orderTotal + cont.orderCount}"></c:set>
<c:set var="syncTotal" value="${syncTotal + cont.syncCount}"></c:set>
<tr>
<td align="center">
<c:if test="${group == 'hour'}">
	 ${cont.moAtHour}
</c:if>
<c:if test="${group == 'day'}">
<a title="点击查看该天的时段分布" href="?group=hour&channel_id=${channel_id}&cmd=${cmd}&start_at=${cont.moAt}&end_at=${cont.moAt}">${cont.moAt}</a>
</c:if>
</td>
<td>${cont.moCount}</td>
<td>${cont.orderCount}</td>
<td>${cont.syncCount}</td>
</tr>
</c:forEach>

			<tr>
				<th>&nbsp;总计</th>
				<th>${moTotal}</th>
				<th>${orderTotal}</th>
				<th>${syncTotal}</th>
			</tr>
		</tbody></table>
	</div>
</body>
</html>